package org.example.listener;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "delStockList", consumerGroup = "test-group")
public class RocketDelStock implements RocketMQListener {
    @Autowired
    private RedisTemplate redisTemplate;

    @Override
    public void onMessage(Object o) {
        Boolean delete = redisTemplate.delete("StockList");
        System.out.println("rocketmq删除数据:" + delete);
    }


}
